import request from '@/utils/request'

// 获取合作商总数
export const usCount = () => request.get('/api/user-service/partner/count')

// 根据售货机获取运营人员列表
export const operatorList = innerCode => request.get(`/api/user-service/user/operatorList/${innerCode}`)

// 根据售货机获取维修人员列表
export const repairerList = innerCode => request.get(`/api/user-service/user/repairerList/${innerCode}`)

// 合作商搜索
export const userSearch = params => request.get('/api/user-service/partner/search', { params })

// 新增合作商
export const addPartner = data => request.post('/api/user-service/partner', data)

// 修改合作商
export const putPartner = (id, data) => request.put(`/api/user-service/partner/${id}`, data)

// 重置合作商密码
export const resetPwd = id => request.put(`/api/user-service/partner/resetPwd/${id}`)

// 删除合作商
export const delPartner = id => request.delete(`/api/user-service/partner/${id}`)

// 人员搜索(列表页)
export const userList = params => request.get('/api/user-service/user/search', { params })

// 新增人员
export const addUser = data => request.post('/api/user-service/user', data)

// 角色列表
export const role = params => request.get('/api/user-service/role', { params })

// 获取用户基本信息
export const getUser = id => request.get(`/api/user-service/user/${id}`)

// 修改人员
export const putUser = (id, data) => request.put(`/api/user-service/user/${id}`, data)

// 删除人员
export const delUser = id => request.delete(`/api/user-service/user/${id}`)

// 人员工作量列表
export const userWorkList = params => request.get('/api/user-service/user/searchUserWork', { params })

// 获取用户工作量(工单统计)
export const userWork = params => request.get('/api/task-service/task/userWork', { params })
